package com.client.service;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.client.mapper.HistoryMapper;
import com.client.mapper.PostMapper;
import com.client.pojo.Post;

@Service
public class HistoryServiceImpl implements HistoryService{
    
	@Autowired
	private HistoryMapper historyMapper;
	@Override
	public String selectType(int userid) {
		String posttype=historyMapper.selectType(userid);
		
		return posttype;
		
	}
	
	
	

	@Autowired
	private PostMapper postMapper;
	@Override
	public List<Post> selectPost(String type) {
		List<Post> postList=postMapper.selectPost(type);
		return postList;
	}
	@Override
	public List<Post> selectfristPost(String type) {
		// TODO Auto-generated method stub
		List<Post> postList=postMapper.selectfristPost(type);
		return postList;
	}
	@Override
	public void addHistory(Integer id, Integer userid, Integer postid, String posttype) {
		System.out.println(posttype);
		historyMapper.addHistory(id, userid, postid, posttype);
	}

}
